@model PopUpOrderDetailViewModel

@{
	string twoLettersCulture = new System.Globalization.CultureInfo(Culture).TwoLetterISOLanguageName;	
}

<div class="view-container">
  <!-- Form begin -->
  <div class="entity-form-container">
    @using (Html.BeginForm("", "", FormMethod.Post, new { id = "" })) {
      @Html.ValidationSummary(true)
      <fieldset>
        <legend>@Resources.OrderDetailResources.OrderDetail</legend>
		<div class="form">
          @Html.HiddenFor(model => model.Id)
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.OrderDetailResources.Quantity)
			  </div>
			  <div class="editor number-editor">
				@Html.TextBoxFor(model => model.Quantity)
				@Html.ValidationMessageFor(model => model.Quantity)
			  </div>
			</div>
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.OrderDetailResources.Price)
			  </div>
			  <div class="editor number-editor">
				@Html.TextBoxFor(model => model.Price)
				@Html.ValidationMessageFor(model => model.Price)
			  </div>
			</div>
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.OrderDetailResources.Tax)
			  </div>
			  <div class="editor number-editor">
				@Html.TextBoxFor(model => model.Tax)
				@Html.ValidationMessageFor(model => model.Tax)
			  </div>
			</div>
			<div class="field">
			  <div class="label">
				@Html.Label(Resources.OrderDetailResources.Discount)
			  </div>
			  <div class="editor number-editor">
				@Html.TextBoxFor(model => model.Discount)
				@Html.ValidationMessageFor(model => model.Discount)
			  </div>
			</div>
		@if(ViewBag.MasterProperty != null && ViewBag.MasterProperty != "Order")
		{
			<div class="field">
			  <div class="label">
			    @Html.LabelFor(model => model.OrderId)
			  </div>
			  <div class="editor">
			    @Html.DropDownListFor(model => model.OrderId, new SelectList(Model.OrderList, "Id", "IdentityDescription", Model.OrderId))           
			    @Html.ValidationMessageFor(model => model.OrderId)
			  </div>
			</div>
		}
		else
		{
			@Html.HiddenFor(model => model.OrderId)
		}
		@if(ViewBag.MasterProperty != null && ViewBag.MasterProperty != "ProductDetail")
		{
			<div class="field">
			  <div class="label">
			    @Html.LabelFor(model => model.ProductDetailId)
			  </div>
			  <div class="editor">
			    @Html.DropDownListFor(model => model.ProductDetailId, new SelectList(Model.ProductDetailList, "Id", "IdentityDescription", Model.ProductDetailId))           
			    @Html.ValidationMessageFor(model => model.ProductDetailId)
			  </div>
			</div>
		}
		else
		{
			@Html.HiddenFor(model => model.ProductDetailId)
		}
		</div>
      </fieldset>
    }
    </div>
	<!-- Form end -->
</div>
<script type="text/javascript">
function @(ViewBag.Name)LoadScripts(detailName)
{
DefaultAddOrDetailPopUpEventTriggers("@(ViewBag.Name)-dialog");
}
</script>
